package com.leoman.userapi.service;

import com.leoman.common.service.GenericManager;
import com.leoman.exception.*;
import com.leoman.message.entity.vo.MessageVo;
import com.leoman.post.entity.PostBase;
import com.leoman.user.entity.UserInfo;
import com.leoman.user.entity.UserIntegral;
import com.leoman.user.entity.UserLogin;
import com.leoman.user.entity.vo.UserCollectVo;
import com.leoman.user.entity.vo.UserInfoPlusVo;
import com.leoman.user.entity.vo.UserInvitedVo;
import com.leoman.user.entity.vo.UserRegisterVo;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 用户接口类
 * Created by 涂奕恒 on 2016/6/12.
 */
public interface UserInfoService extends GenericManager<UserInfo> {

    UserLogin registerCheck(UserRegisterVo urv) throws UserExistException, CodeErrorException;

    UserInfo register(UserRegisterVo urv) throws UserExistException, CodeErrorException, UserNicknameExistException, SensitiveWordExistException;

    UserInfo findOne(Long userId) throws UserNotFindException;

    @SuppressWarnings("unused")
    UserInfo findUserLoginById(Long userId) throws UserNotFindException;

    UserInfo findOne(Long sourceId, Long userId, Integer type) throws UserNotFindException;

    UserInfoPlusVo findCreatorInfo(Long creatorId, Long userId) throws ParamsErrorException, CreatorNotFindException;

    void attention(Long userId, Long sourceId, Integer type) throws ParamsErrorException, UserNotFindException, CreatorNotFindException, AttentionExistException, AttentionNotFindException;

    @SuppressWarnings("unused")
    List<UserCollectVo> findCollectListByUserId(Long userId) throws UserNotFindException;

    Page<PostBase> findCollectListByUserIdPost(Long userId, Integer pageNum, Integer pageSize);

    void collect(Long userId, Long sourceId, Integer type, Integer status) throws ParamsErrorException, UserNotFindException, CollectExistException, CollectNotFindException;

    void praise(Long userId, Long sourceId, Integer type, Integer status) throws ParamsErrorException, UserSpeakErrorException, PraiseExistException, PraiseNotFindException;

    void praise2(Integer isDetail, Long userId, Long sourceId, Integer type, Integer status) throws ParamsErrorException, UserNotFindException, PraiseExistException, PraiseNotFindException, UserStatusErrorException;

    void modifyCreatorInfo(Long creatorId, Long cityId, String description, String weibo, String experience) throws ParamsErrorException, CreatorNotFindException;

    void binding(Long userId, Integer type, String openId, String nickname) throws UserNotFindException, ThirdExistException;

    void bindingMobile(Long userId, String mobile, String code, String password, String nickname, String openId, Integer type) throws ParamsErrorException, UserNotFindException, CodeErrorException, MobileExistException, UserNicknameExistException, SensitiveWordExistException;

    Page<UserIntegral> integralPage(Long userId, Integer pageNum, Integer pageSize) throws UserNotFindException;

    List<UserInfo> findOneByWeixin(String weixin);

    List<UserInfo> findOneByWeibo(String weibo);

    List<UserInfo> findOneByQQ(String qq);

    @SuppressWarnings("unused")
    UserInfo findOneByNickname(String nickname);

    // 回复我的帖子的用户列表
    Page<MessageVo> pageMessage(Long userId, Integer pageNum, Integer pageSize);

    // 分享获取馒头数
    void share(Long userId) throws UserNotFindException, UserStatusErrorException;

    // 邀请用户注册获取馒头
    Integer invited(Long userId, String nickname, String mobile) throws ParamsErrorException, UserNotFindException, InvitedErrorException, InvitedCountErrorException, InvitedUserExistException, UserStatusErrorException;

    // 邀请注册信息
    UserInvitedVo invitedInfo(Long userId) throws UserNotFindException, UserStatusErrorException;

    // 查询发帖字数限制
    Integer sendPostCount();

    // 过滤关键词
    String replaceContent(String word);

    UserInfo getUserInfo(Long userId) throws UserNotFindException, UserStatusErrorException;

    // 用户申请为主创
    void sendCheck(Long userId,
                   String userName,
                   String profession,
                   String mobile,
                   String description,
                   String reasonContent) throws ParamsErrorException, UserSpeakErrorException, UserSendCheckExistException;
}
